package task20;

import java.util.Scanner;

public class ExceptionTest {
    public static void main(String[] args) {
        System.out.println("请输入除数");
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();

        try{
            int result=4/a;
            System.out.println("结果是："+result);

        }catch(Exception e){
            System.out.println("出现异常："+e.getMessage());
        }finally{
            System.out.println("都要执行的代码");

        }

    }

}
